<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        body {
            background-color: #f5f5f5;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-image: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        }

        .container {
            width: 100%;
            max-width: 400px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
            overflow: hidden;
            animation: fadeIn 0.5s ease-in-out;
        }

        .header {
            background-color: #ff6b6b;
            color: rgb(248, 248, 248);
            padding: 0.5rem;
            text-align: center;
        }

        .conntent {
            margin-left: 4.5rem;
            margin: 0, auto;
        }

        .conntent #btn {
            width: 250px;
            height: 40px;
            color: white;
            background-color: rgb(255, 12, 36);
            border-radius: 5px;
            border: none;
            margin-top: 1rem;
            margin-bottom: 1rem;
        }
    </style>
</head>

<body>

    <div class="container">
        <div class="header">
            <h1>表白墙</h1>
        </div>

        <div class="conntent">
            你的名字：<input type="text" id="1"><br>
            你对谁说：<input type="text" id="2"><br>
            说什么话：<input type="text" id="3"><br>
            <button id="btn" onclick="submit()">确认提交</button>
        </div>
    </div>


    <script src="jquery-3.7.1.min.js"></script>
    <script>
        function submit() {
            let conntent1 = $("#1").val();
            let conntent2 = $("#2").val();
            let conntent3 = $("#3").val();

            //拼接html
            let ret_html = "<div>" + conntent1 + " 对 " + conntent2 + " 说：" + conntent3 + "</div>";
            //追加到div中
            $(".conntent").append(ret_html);
            $(":text").val("");
        }
    </script>


</body>

</html>